import store from '@/vuex/index'
export function routerResolve(path){
    return (resolve) => require([`../pages${path}`],resolve)
}
export function searchParamsComputed (searchList = [], vuexModelName = '') {
    let computed = {}
    searchList.forEach(item => {
        computed[item] = {
            get () {
                return store.state[vuexModelName].postParams[item]
            },
            set (val) {
                store.commit(vuexModelName + '/updatePostParams', {
                    [item]: val
                })
            }
        }
    })
    return computed
}
export function jumpto (path = '', params = {}) {
    this.$router.push({
        path:path,
        query:{...params}
    });
}